﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace ProgramMain.Framework
{
    public class StringItem : IComparable
    {
        public string Value;
        
        public StringItem()
        {
            Value = "";
        }

        public StringItem(string Val)
        {
            Value = Val;
        }

        public int CompareTo(object obj)
        {
            if (obj == null)
                return 1;
            else
                return Value.CompareTo(((StringItem)obj).Value);
        }
    };

    public class GridViewLayoutHistory : SerializableHistoryList<StringItem, StringItem>
    {
        public GridViewLayoutHistory()
        {
            MaxSize = 100;
        }

        public void StoreLayoutHistory(string gridID, string Layout)
        {
            StoreToHistory(new StringItem(gridID), new StringItem(Layout));
        }

        public string ReadLayoutHistory(string clientID)
        {
            return ReadFromHistory(new StringItem(clientID)).Value;
        }
    }
}